﻿using System;
using GameEngine.Model;
using GameEngine.Model.Data;
using PureMVC.Interfaces;
using PureMVC.Patterns;

namespace GameEngine.Controller
{
    public class ControlThingPositionCommand<MyIdType> : SimpleCommand
        where MyIdType : IComparable<MyIdType>
    {
        override public void Execute(INotification notification)
        {
            IThingVOId<MyIdType> thing = notification.Body as IThingVOId<MyIdType>;
            IThingDataProxy<MyIdType> thingDataProxy = ModelFacade<MyIdType>.Helper.GetThingDataProxy(thing);
            IWorldDataProxy<MyIdType> worldDataProxy = ModelFacade<MyIdType>.Helper.GetWorldDataProxy(thingDataProxy.WorldId);
            worldDataProxy.ControlThingPosition(thingDataProxy);
        }
    }
}
